//package cn.stylefeng.guns.run;
//
//import cn.hutool.core.date.DateTime;
//import cn.hutool.core.date.DateUtil;
//import cn.hutool.core.date.SystemClock;
//import cn.hutool.core.thread.ThreadUtil;
//import cn.hutool.core.util.StrUtil;
//import cn.hutool.http.ContentType;
//import cn.hutool.http.HttpUtil;
//import cn.stylefeng.guns.modular.info.entity.AicaiGame;
//import cn.stylefeng.guns.modular.info.entity.Game;
//import cn.stylefeng.guns.modular.info.mapper.AicaiGameMapper;
//import cn.stylefeng.guns.modular.info.mapper.GameMapper;
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.CommandLineRunner;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//import java.util.*;
//import java.util.stream.Collectors;
//
///**
// * @program: football_manage
// * @description:
// * @author: xiesm
// * @create: 2021-07-08 09:32
// **/
//@Component
//public class AicaiRunner implements CommandLineRunner {
//
//    @Autowired(required = false)
//    private AicaiGameMapper aicaiGameMapper;
//    @Autowired(required = false)
//    private GameMapper gameMapper;
//
//
//    @Override
//    public void run(String... args) throws Exception {
//        ThreadUtil.execute(() -> {
//            List<AicaiGame> games = aicaiGameMapper.selectList(null);
//            Set<Integer> matchIds = games.stream().map(game -> game.getId()).collect(Collectors.toSet());
//            for (int i = 1; i <= 7; i++) {
//                for (int j = 1; j <= 13; j++) {
//                    if (Arrays.asList(2, 4, 6, 9, 11).contains(i) && j == 31) {
//                        continue;
//                    }
//                    if (i == 2 && j > 28) {
//                        continue;
//                    }
//                    if (i == 7 && j > 13) {
//                        continue;
//                    }
//                    String month = StrUtil.padPre(String.valueOf(i), 2, "0");
//                    String day = StrUtil.padPre(String.valueOf(j), 2, "0");
//                    String date = StrUtil.format("2021-{}-{}", month, day);
//                    System.out.println(date);
//                    try {
//                        searchMatch(date, matchIds);
//                        ThreadUtil.sleep(200);
//                    } catch (IOException e) {
//                        e.printStackTrace();
//                    }
//                }
//            }
//        });
//    }
//
//
//}
